<include file="Public:header" />
<div class="container"> 
  <div class="mainbody">
  <include file="Public:redmenu" />
    <div class="rig_lm03">
      <div class="title" ><img src="{$Think.config.static_path}images/listicon.jpg" class="icon" >
        <h2>添加/修改红包信息</h2>
      </div>
      <div class="detail-tab">
          <form name="form1"  enctype="multipart/form-data" method="post" action="__URL__/doAdd" role="form" >
          <div class="form-group">
            <label for="name">红包奖项<i>*</i></label>
            <input type="text" name="praisename" class="searcheTxt"  id="name" placeholder="" value="{$data.praisename}">
          </div>
          <div class="form-group">
            <label for="name">红包内容<i>*</i></label>
            <input type="text" name="praisecontent" class="searcheTxt"  id="name" placeholder="" value="{$data.praisecontent}">
          </div>
		  <if condition="$data.id neq ''">
           <div class="form-group">
            <label for="name">红包剩余数量<i>*</i></label>
            <input type="text" name="praisenumber" class="searcheTxt"  id="name" placeholder=""  value="{$data.praisenumber}">
          </div>
          <else/>
           <div class="form-group">
            <label for="name">红包总数<i>*</i></label>
            <input type="text" name="praisetotal" class="searcheTxt"  id="name" placeholder=""  value="{$data.praisetotal}">
          </div>
          </if>
		   <div class="form-group">
            <label for="name">红包中奖概率<i>*</i></label>
            <input type="text" name="chance" class="searcheTxt"  id="name" placeholder=""  value="{$data.chance}">
          </div>
         
          
          <div class="form-group ">
            <label for="IbtnEnter"></label>
            <button type="button"  id="IbtnEnter" class="btn btn-primary "><span class="glyphicon glyphicon-floppy-saved"></span> 保 存 </button>
          </div>
          <input type="hidden" name="id" value="{$data.id}">
          <input type="hidden" name="sid" value="{$_GET['sid']?$_GET['sid']:$data['sid']}">
          </form>
      </div>
    </div>
  </div>
</div>

<style type="text/css">
 .img{  width: 110px; height: 160px;}
 .img2{ width: 240px; height: 165px;}
</style>

<include file="Public:footer" /> 
<script type="text/javascript">

$(function(){
	
	$("#IbtnEnter").click(function(){
		   saveActivity();
	 });
	$("#IbtnEnter").click(function(){
		   saveActivity();
	 });
});

function saveActivity() {
    var state = true;
    if ($("#name").attr("value") == "") {
        alert("请输入姓名！");
        state = false;
        $("#name").focus();
        return false
    }
    
    if (state) {
       $("form").submit();
		//commonAjaxSubmit("__URL__/saveAddAvtivity","{$_REQUEST['id']}");
    }
};
</script>